<script setup lang='ts'>
import { inject, onBeforeUnmount } from 'vue';
import { createVueDisposer, toVR } from 'vue-xe2-plugin/dist-node/components/xe2/tools';
import Button from '../../components/Button.vue';
import RightList from '../../components/RightList.vue';
import { XbsjEarthUi } from '../../scripts/xbsjEarthUi';
const xbsjEarthUi = inject('xbsjEarthUi') as XbsjEarthUi


const disposer = createVueDisposer(onBeforeUnmount);
const showJnpfTreeViewRef = toVR<boolean>(disposer, [xbsjEarthUi, "showJnpfTreeView"])//sino更新
const scenetreeControlRef = toVR<boolean>(disposer, [xbsjEarthUi, "sceneTreeControl"])//sino更新
const jnpfTreeControlRef = toVR<boolean>(disposer, [xbsjEarthUi, "jnpfTreeControl"])//sino更新
const showSceneTreeViewRef = toVR<boolean>(disposer, [xbsjEarthUi, "showSceneTreeView"])
const showCompassRef = toVR<boolean>(disposer, [xbsjEarthUi.navigatorManager,"navigatorShow"])
const showDistanceLegendRef = toVR<boolean>(disposer, [xbsjEarthUi.navigatorManager,"scaleShow"])
const showstatusBarRef = toVR<boolean>(disposer, [xbsjEarthUi.navigatorManager,"statusBarShow"])
</script>
<template>
    <RightList :title="'控件'" :is-top="true">
        <!-- sino更新 -->
        <Button :name="'tucengguanli'" :content="'数据管理'"
        v-if="jnpfTreeControlRef" :click="() => { showJnpfTreeViewRef = !showJnpfTreeViewRef }" :actived="showJnpfTreeViewRef" ></Button>
        <!-- sino更新 -->
        <Button :name="'tucengguanli'" :content="'图层管理'" :click="() => { showSceneTreeViewRef = !showSceneTreeViewRef }"
            v-if="scenetreeControlRef" :actived="showSceneTreeViewRef" :left-button="true"></Button>
        <Button :name="'daohangkongjian'" :content="'导航控件'" :click="() => { showCompassRef = !showCompassRef }"
            :actived="showCompassRef"></Button>
        <Button :name="'bilichi'" :content="'比例尺'" :click="() => { showDistanceLegendRef = !showDistanceLegendRef }"
            :actived="showDistanceLegendRef" :left-button="true"></Button>
        <Button :name="'zhuangtailan'" :content="'状态栏'" :click="() => { showstatusBarRef = !showstatusBarRef }"
            :actived="showstatusBarRef"></Button>
    </RightList>
</template>
